<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link href="../../js/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="footer.css" />
		<link rel="stylesheet" href="../../css/lystyle.css" />
		<style type="text/css">
			/*修改底部字体颜色*/
			
			.foot:nth-child(2) {
				color: #e83023;
			}
		</style>
		<script src="../../js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div id="wrap">
			<div id="main">
				<div id="header">
					<a id="headImg" href="javascript:history.go(-1)"><img class="headImg" src="../../images/12.png" /></a>
					<p id="headTitle">设置</p>
				</div>
				<div id="content">
					<ul class="ly-person" style="padding-bottom: 0;">
						<li class="ly-person-li">
							<a href="person_accountManage.html">
								<span>账号与安全<img src="../../images/personage/anquan.png" style="height: 0.466rem; padding-left: 0.1rem;"/></span><img src="../../images/personage/more.png" />
							</a>
						</li>
						<li class="ly-person-li" >
							<a onclick="out()">
								<span>退出登录</span>
							</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<script src="../../js/jquery-2.2.3.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/jquery.cookie.js"></script>
		<script type="text/javascript">
			var tokenReztApp = $.cookie("tokenReztApp");
			if(!tokenReztApp) {
				window.location.href = "../login/login/login.html";
			}
			$(function() {
				currentyf();
			});

			//用户信息
			var user, role, goodsId;
			//获取当前会员信息
			function currentyf() {
				$.ajax({
					cache: false,
					type: "GET",
					url: "http://47.104.13.109/member-service/auth/current?token=" + tokenReztApp,
					dataType: "JSON",
					async: false,
					error: function(XMLHttpRequest, textStatus, errorThrown) {
						$.removeCookie('tokenReztApp', {
							expires: 7,
							path: '/'
						});
						$.removeCookie("tokenRh", {
							expires: 7,
							path: '/'
						});
						$.removeCookie('memberId', {
							expires: 7,
							path: '/'
						});
						$.removeCookie('roleId', {
							expires: 7,
							path: '/'
						});
						window.location.href = "../login/login/login.html";
					},
					success: function(data) {
						user = data.loginName;
						role = data.roleList[0].id; //角色
						goodsId = data.id;

					}
				});
			}

			function out() {
				$.ajax({
					type: "get",
					url: "http://47.104.13.109/member-service/auth/logout?token=" + $.cookie('tokenRh'),
					async: false,
					success: function(res) {
						$.removeCookie('tokenReztApp', {
							expires: 7,
							path: '/'
						});
						$.removeCookie("tokenRh", {
							expires: 7,
							path: '/'
						});
						$.removeCookie('memberId', {
							expires: 7,
							path: '/'
						});
						$.removeCookie('roleId', {
							expires: 7,
							path: '/'
						});
						console.log(res);
						window.location.href = "../login/login/login.html";
					},
					error: function(res) {
						console.log(res);
					}
				});
			}
		</script>
	</body>

</html>